package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ConstructionAnnouncementMapper;
import com.ruoyi.system.domain.ConstructionAnnouncement;
import com.ruoyi.system.service.IConstructionAnnouncementService;

/**
 * 施工公告Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-06-22
 */
@Service
public class ConstructionAnnouncementServiceImpl implements IConstructionAnnouncementService 
{
    @Autowired
    private ConstructionAnnouncementMapper constructionAnnouncementMapper;

    /**
     * 查询施工公告
     * 
     * @param caId 施工公告ID
     * @return 施工公告
     */
    @Override
    public ConstructionAnnouncement selectConstructionAnnouncementById(Long caId)
    {
        return constructionAnnouncementMapper.selectConstructionAnnouncementById(caId);
    }

    /**
     * 查询施工公告列表
     * 
     * @param constructionAnnouncement 施工公告
     * @return 施工公告
     */
    @Override
    public List<ConstructionAnnouncement> selectConstructionAnnouncementList(ConstructionAnnouncement constructionAnnouncement)
    {
        return constructionAnnouncementMapper.selectConstructionAnnouncementList(constructionAnnouncement);
    }

    /**
     * 新增施工公告
     * 
     * @param constructionAnnouncement 施工公告
     * @return 结果
     */
    @Override
    public int insertConstructionAnnouncement(ConstructionAnnouncement constructionAnnouncement)
    {constructionAnnouncement.setCreateTime(DateUtils.getNowDate());
        return constructionAnnouncementMapper.insertConstructionAnnouncement(constructionAnnouncement);
    }

    /**
     * 修改施工公告
     * 
     * @param constructionAnnouncement 施工公告
     * @return 结果
     */
    @Override
    public int updateConstructionAnnouncement(ConstructionAnnouncement constructionAnnouncement)
    {constructionAnnouncement.setUpdateTime(DateUtils.getNowDate());
        return constructionAnnouncementMapper.updateConstructionAnnouncement(constructionAnnouncement);
    }

    /**
     * 批量删除施工公告
     * 
     * @param caIds 需要删除的施工公告ID
     * @return 结果
     */
    @Override
    public int deleteConstructionAnnouncementByIds(Long[] caIds)
    {
        return constructionAnnouncementMapper.deleteConstructionAnnouncementByIds(caIds);
    }

    /**
     * 删除施工公告信息
     * 
     * @param caId 施工公告ID
     * @return 结果
     */
    @Override
    public int deleteConstructionAnnouncementById(Long caId)
    {
        return constructionAnnouncementMapper.deleteConstructionAnnouncementById(caId);
    }
}
